
#include <mockcpp/mockcpp.hpp>
#include <testngpp/testngpp.hpp>
#include <Square.h>

USING_MOCKCPP_NS
USING_TESTNGPP_NS

FIXTURE(FixedSquare)
{
	TEST(Should be able to caculate the area of a square - width 5, area = 25)
	{
		Square square(5);
		ASSERT_EQ(25, square.getArea());
	}

	TEST(Should be able to caculate the perimeter of a square - width 10, perimeter = 40)
	{
		Square square(10);
		ASSERT_EQ(40, square.getPerimeter());
	}


};

FIXTURE(AlterableSquare)
{
	Square* pSquare;

	SETUP()
	{
		pSquare = new Square(5);
                pSquare->setWidth(15);
	}

	TEARDOWN()
	{
		delete pSquare;
	}	

	TEST(Should be able to caculate the area of a square after changing the width - width 5->15, area = 225)
	{
		ASSERT_EQ(225, pSquare->getArea());
	}

	TEST(Should be able to caculate the perimeter of a square after changing the width - width 5->15, area = 60)
	{
		ASSERT_EQ(60, pSquare->getPerimeter());
	}


};
